'use strict';

var arr = [1,2,3,4,5,6,7,8,9,];
//输出数组中的奇数
var r =arr.filter(function(i){
    return i % 2 != 0;
})
console.log(r);

var arr1 = ['','AAA',null,undefined,'BBB'];
var r1 = arr1.filter(function (elements,index,self) {
   
    console.log(elements);
    console.log(index);
    console.log(self);
    return elements && elements.trim();
});
console.log(r1);

